Report post

What does empty mean in jQuery?

jQuery's :empty selector is quite literal: An element is only empty if it doesn't have any child nodes. But your definition may be more loose — for instance, perhaps you want to consider an element that contains only whitespace (directly or in descendant elements) "empty" for your purposes (in which case: !el.textContent.trim () ).

Does jQuery have a 'empty' selector?

But this partially comes down to what you consider "empty." jQuery's :empty selector is quite literal: An element is only empty if it doesn't have any child nodes.

What does isempty() do?

isEmpty_.isEmpty (object) Returns true if an enumerable object contains no values (no enumerable own-properties). For strings and array-like objects _.isEmpty checks if the length property is 0. function isEmpty (property) { return (property === null || property === "" || typeof property === "undefined"); }

Should jQuery argument be a plain JavaScript Object?

Actually, jQuery documentation says The argument should always be a plain JavaScript Object as other types of object (DOM elements, primitive strings/numbers, host objects) may not give consistent results across browsers. Sorry, didn't see @rhinoxi 's answer.

The World's Leading Crypto Trading Platform

Get my welcome gifts